<!DOCTYPE html>
<html>	
<head>
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="templatss/style.css" rel='stylesheet' type='text/css' />
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=PT+Sans:400,700,400italic,700italic|Oswald:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
<!--//webfonts-->
<script src="templatss/jquery.min.js"></script>
</head>
<body>
<script>$(document).ready(function(c) {
	$('.close').on('click', function(c){
		$('.login-form').fadeOut('slow', function(c){
	  		$('.login-form').remove();
		});submit
	});	  
});
</script>
 <!--SIGN UP-->
 <h1>登陆</h1>
<div class="login-form">
	<div class="close"> </div>
		<div class="head-info">
			<label class="lbl-1"> </label>
			<label class="lbl-2"> </label>
			<label class="lbl-3"> </label>
		</div>
			<div class="clear"> </div>
	<div class="avtar">
		<img src="../templatss/avtar.png" />
	</div>
			<form>
					<input type="text" class="text" id="p"   placeholder="phone" >
						<div class="key">
					<input type="password" id="s"placeholder="password" >
						</div>
			</form>
	<div class="signin">
		<input type="submit" value="登陆"  id="btn">
	</div>
	
		<input type="button" value="注册"  id="btn01" style="background-color: black; color: #fff;">
	
	 <span id="sho" style="color:red;"></span>
</div>

<script>
	$(function() {
		$('#btn').click(function() {
			var phone = $("#p").val();
			var password = $("#s").val();
			if(phone ==''){
				$('#sho').text("请输入账号或密码").fadeIn(1000)
				$('#sho').text("请输入账号或密码").fadeOut(1000)
			}
			$.ajax({
				type: "GET",
				url: "http://localhost:8088/user/1/"+phone,
				async: true,
				dataType: "json",
				data: {
					phone: phone,
					password: password,
				},
				success: function(data) {
					console.log(data)
					console.log(data.resp_code)
					if (data.resp_code == 000000) {
						if(data.result == 'true'){
							$('#sho').text(data.resp_message).fadeIn(1000)
							$('#sho').text(data.resp_message).fadeOut(1000)
							window.location.href="medicalrecords.html"
						}else{
							$('#sho').text("账号或密码错误").fadeIn(1000)
							$('#sho').text("账号或密码错误").fadeOut(1000)
						}
					} else {
						$('#sho').text(data.resp_message).fadeIn(1000)
						$('#sho').text(data.resp_message).fadeOut(1000)
					}
				},
				error: function(data) {
					console.log(data);
				}
			})
		});
		
			$('#btn01').click(function() {
					window.location.href="register.html"
			});
		
	});
</script>
		

</body>
</html>